package com.zdlee.netty.server20.client.console;

import com.zdlee.netty.server15.request.MessageRequestPacket;
import io.netty.channel.Channel;

import java.util.Scanner;

/**
 * @author zdlee
 * @description: ${DESCRIPTION}
 * @create 2018-12-01 13:34
 */
public class SendToUserConsoleCommand implements ConsoleCommand {
    @Override
    public void exec(Scanner sc, Channel channel) {
        System.out.print("发送消息给某个某个用户：");
        String toUserId=sc.next();
        String message=sc.next();
        channel.writeAndFlush(new MessageRequestPacket(toUserId,message));
    }
}
